/* eslint-disable @typescript-eslint/no-explicit-any */
export function ignoreError<T extends (...args: any[]) => Promise<void>>(fn: T) {
  return async (...args: Parameters<T>) => {
    try {
      return await fn(...args)
    } catch (error) {
      console.error(error)
    }
  }
}
